# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=opensmtpd-table-ldap
pkgver=1.0
pkgrel=0
pkgdesc="OpenSMTPD LDAP tables"
url="https://github.com/OpenSMTPD/table-ldap"
arch="all"
license="ISC"
makedepends="
	autoconf
	automake
	libretls-dev
	"
subpackages="$pkgname-doc"
source="https://github.com/OpenSMTPD/table-ldap/archive/$pkgver/opensmtpd-table-ldap-$pkgver.tar.gz
	remove-decls.patch
	"
builddir="$srcdir/table-ldap-$pkgver"
options="!check"  # upstream does not provide tests

prepare() {
	default_prepare
	./bootstrap
}

build() {
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc/smtpd
	make
}

package() {
	make DESTDIR="$pkgdir" smtpdir="/usr/lib/opensmtpd" install

	install -D -m644 table-ldap.conf.example -t "$pkgdir"/usr/share/doc/opensmtpd/
}

sha512sums="
556d1ea36427791a0f2fc4c985aa9ce0059131025e81e8ab64102c8e0b4d7dd2e699d5a317975e1caabe68ac3a0082551799f6c7e03483b5ffe7d82c0eb8bf9a  opensmtpd-table-ldap-1.0.tar.gz
85aa28c973edd0b4bd2f390f20da21f92091cd191498a5cc953d3b188cb6f6ef7ed73e3ee48489f8f1ec89b58b9356a90eea9a6ac1cfebf07631947d0bfaa5a1  remove-decls.patch
"
